﻿import { IWebException } from '../common/http/IWebException';
import { Logger } from "../common";
export class WebException extends Error implements IWebException {
    message;
    private module;
    private innerException;
    private status = 500;

    constructor(message: string, innerException?) {
        super(message);
        this.message = message;
        this.innerException = innerException;
        this.module = {
            name: "WebAPIException"
        }
        new Logger().getLogger('error').error(this.module.name, this);
    }

    get Status() { return this.status; }
    get Message() { return this.message; }
    get Module() { return this.module; }
    get InnerException() { return this.innerException; }
} 